//
//  HCFindCollectionViewCell.m
//  HappyChildren
//
//  Created by WillyZhao on 2016/12/30.
//  Copyright © 2016年 WillyZhao. All rights reserved.
//

#import "HCFindCollectionViewCell.h"

#import "HCFindModel.h"
#import "HCAllUsedModel.h"
#import "HCEveryDayModel.h"
@implementation HCFindCollectionViewCell

- (void)awakeFromNib {
    [super awakeFromNib];
    
//    [self.priceLabel setFont:YBKSystemFont(YBKAdaptiveFont(12)) childrenString:@"￥"];
    if (iPhone5) {
        self.topImageView.constant = 0;
    }else{
        self.topImageView.constant = 10;
    }
    // Initialization code
}

-(void)setModel:(id)model {

    if ([model isKindOfClass:[HCFindData class]]) {
        HCFindData *data = (HCFindData *)model;
        [self.contIMG sd_setImageWithURL:[NSURL URLWithString:[NSString stringWithFormat:@"%@",data.logo]]];
        
        self.name.text = [NSString stringWithFormat:@"%@",data.name];
        self.contText.text = [NSString stringWithFormat:@"%@",data.about];
        self.priceLabel.hidden = YES;
    }
    
    if ([model isKindOfClass:[HCEveryDayData class]]) {
        HCEveryDayData *data = (HCEveryDayData *)model;
        [self.contIMG sd_setImageWithURL:[NSURL URLWithString:[NSString stringWithFormat:@"%@",data.path]]];
        
        self.name.text = [NSString stringWithFormat:@"%@",data.name];
//        self.contText.text = [NSString stringWithFormat:@"%@",data.about];
        self.priceLabel.hidden = YES;
    }
    
    if ([model isKindOfClass:[HCAllUsedData class]]) {
        HCAllUsedData *data = (HCAllUsedData *)model;
        [self.contIMG sd_setImageWithURL:[NSURL URLWithString:[NSString stringWithFormat:@"%@",data.path]]];
        
        self.name.text = [NSString stringWithFormat:@"%@",data.name];
//        self.contText.text = [NSString stringWithFormat:@"%@",data.about];
        self.priceLabel.hidden = YES;
    }
    
}

@end
